package dongshi.daddy.main;

import dongshi.daddy.service.MyEventNotifyService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConsumerWithEventNotifyMain {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context
                = new ClassPathXmlApplicationContext("consumer-with-event-notify.xml");
        context.start();
        MyEventNotifyService myEventNotifyService
                = (MyEventNotifyService) context.getBean("myEventNotifyServiceInConsumerSide");
        // 正常调用
        System.out.println("---" + myEventNotifyService.getUserName("1503892") + "---");
        // 发生异常
        System.out.println("---" + myEventNotifyService.getUserName("") + "---");
    }
}
